target=test
sources=$(wildcard *.c)
objects=$(subst .c,.o,$(sources))

oop_base_lib=oop_base/liboop_base.a
classes_lib=classes/libclasses.a

CC:=gcc
CFLAGS+=-I oop_base -std=c99# -g

all:$(target)

$(oop_base_lib):
	make -C oop_base

$(classes_lib):
	make -C classes

$(target):$(objects) $(classes_lib) $(oop_base_lib)
	$(CC) -o $@ $^ -L oop_base -L classes -loop_base -lclasses

clean:
	make -C oop_base clean
	make -C classes clean
	-rm -f $(objects)
